home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 34.zip
/
BS1 part 34
/
FredFish PD 319.adf
/
CNewsSrc
/
cnews.src.lzh
/
libc
/
emalloc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-07-05
|
403b
|
26 lines
/*
* emalloc - malloc with Error() called when out of space
*/
#include <stdio.h>
#include <sys/types.h>
#include "libc.h"
extern void Error();
char *
emalloc(amount)
unsigned amount;
{
register char *it;
char camount[25]; /* Enough to sprintf an unsigned. */
it = malloc(amount);
if (it == NULL) {
sprintf(camount, "%u", amount);
Error("malloc(%s) failed", camount);
}
return(it);
}